package Kernel;

import java.io.*;

public abstract class Arc {
	
	protected Transition t;
	protected Place p;
	protected long weight;
	
	public Arc(Place p, Transition t) {
		this.p = p;
		this.t = t;
		this.weight = 1;
	}
	public Arc(Place p, Transition t, long weight) {
		this.p = p;
		this.t = t;
		this.weight = weight;
	}
	public Place GetPlace() {
		return p;
	}
	public Transition GetTransition(){
		return t;
	}
	public long GetWeight() {
		return weight;
	}
	public void SetWeight(long w) {
		weight = w;
	}
	public abstract void Fire();
	public abstract boolean Check_State();

	public void Store(ObjectOutputStream oos) throws IOException{
		oos.writeLong(weight);
	}
	public void Load(ObjectInputStream ois) throws IOException{
		weight = ois.readLong();
	}
}

